<!DOCTYPE html>
<html>
<!-- head -->
{include file="common/page/head"}
<link rel="stylesheet" href="__app__/admin/view/StoreGoods/addGoods/addGoods.css" />
<body>
<!---------------- 添加商品 ------------------->
<!-- 页头 -->
{include file="common/page/header"}
<!-- jsfiles -->
{include file="common/page/jsfiles"}
<link href="__static__/js/umeditor/themes/default/css/umeditor.min.css" type="text/css" rel="stylesheet">
<script type="text/javascript" charset="utf-8" src="__static__/js/umeditor/third-party/template.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__static__/js/umeditor/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__static__/js/umeditor/umeditor.min.js"></script>
<script type="text/javascript" src="__static__/js/umeditor/lang/zh-cn/zh-cn.js"></script>
<!-- 主体 -->
<div class="content container-fluid{if $leftBarScale eq '1'} scale{/if}">
    <div class="row">
        <div class="col-md-2 left-section">
            <!-- 左导航菜单 -->
            {include file="common/page/menu"}

        </div>
        <div class="col-md-10 right-section">
            <!--内容区域-->
            <h3><i class="icon iconfont">{$Think.session.currentMenu.icon}</i>添加商品</h3>
            <div class="inner-section row">
                <div class="items add-div">
                    <form action="#" method="post" id="myForm"  enctype="multipart/form-data">
                        <table class="table table-striped table-hover table-bordered table-base">
                            <tr>
                                <td class="td1"><label>分类</label></td>
                                <td class="td2">
                                    <div class="category-list row">
                                        {foreach $cateList as $cate}
                                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 category">
                                            {$cate.name}</div>
                                        {/foreach}
                                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 category">
                                            <a href="javascript:window.history.go(-1)">修改</a></div>
                                    </div>
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label>多规格模板</label></td>
                                <td class="td2">
                                    <select class="form-control" name="tid" id="tid">
                                        <option value="">统一规格</option>
                                        {foreach $templateList as $template}
                                        <option value="{$template.id}">{$template.name}</option>
                                        {/foreach}
                                    </select>
                                    <input type="hidden" name="standard" id="standard" value="0">
                                    <input type="hidden" name="propertyGroups" id="propertyGroups" value="">
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr class="property-tr hidden">
                                <td class="td1"><label>商品属性</label></td>
                                <td class="td2">
                                    <div class="property-group-wrap">
                                    </div>
                                    <div class="add-property-group-wrap">
	                                    <span class="property-group-action">
	                                    	<a class="btn btn-primary btn-sm property-group-add" href="javascript:;">添加</a>
	                                    </span>
                                    </div>
                                </td>
                                <td class="td3 property-info"></td>
                            </tr>
                            <tr class="hidden">
                                <td class="td1"><label for="name"><span class="must-tag">*</span>商品标题</label></td>
                                <td class="td2"><input type="text" id="title" name="title" placeholder="商品标题"></td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label for="name"><span class="must-tag">*</span>商品名称</label></td>
                                <td class="td2"><input type="text" id="name" name="name" placeholder="商品名称"></td>
                                <td class="td3"></td>
                            </tr>
                            <tr id="image_type">
                                <td class="td1"><label for="imgurl"><span class="must-tag">*</span>主图上传</label></td>
                                <td class="td2"><input class="imgurl form-control" title="支持jpg、jpeg、gif、png格式，文件小于5M" tabindex="3" type="file"  accept="image/*" id="imgurl" name="imgurl" size="3"></td>
                                <td class="td3"></td>
                            </tr>
                            <tr id="video_type" class="hidden">
                                <td class="td1"><label for="videoUrl"><span class="must-tag">*</span>视频上传</label></td>
                                <td class="td2"><input class="videoUrl form-control"  tabindex="3" type="file"  id="videoUrl" name="videoUrl" size="3"></td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label>辅图上传</label></td>
                                <td class="td2">
                                    <input class="side-image form-control" title="支持jpg、jpeg、gif、png格式，文件小于5M" type="file" name="sideImg1">
                                    <input class="side-image form-control" title="支持jpg、jpeg、gif、png格式，文件小于5M" type="file" name="sideImg2">
                                    <input class="side-image form-control" title="支持jpg、jpeg、gif、png格式，文件小于5M" type="file"  name="sideImg3">
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label for="name"><span class="must-tag">*</span>标准价格</label></td>
                                <td class="td2"><input type="text" id="price" name="price" placeholder="标准价格"></td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label for="ori_price"><span class="must-tag">*</span>商品原价</label></td>
                                <td class="td2">
                                    <input type="text" id="ori_price" name="ori_price" placeholder="商品原价"></td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label>商品数量</label></td>
                                <td class="td2">
                                    <select class="form-control" name="count_id" id="count_id">
                                        <option value="">0</option>
                                        {foreach $countList as $count}
                                        <option value="{$count.id}">{$count.count}</option>
                                        {/foreach}
                                    </select>
                                </td>
                                <td class="td3">个</td>
                            </tr>
                            <tr>
                                <td class="td1"><label>商品优惠</label></td>
                                <td class="td2">
                                    <select class="form-control" name="discount_id" id="discount_id">
                                        <option value="">0</option>
                                        {foreach $discountList as $discount}
                                        <option value="{$discount.id}">{$discount.discount}</option>
                                        {/foreach}
                                    </select>
                                </td>
                                <td class="td3">元</td>
                            </tr>
                            
                            <tr class="hidden">
                                <td class="td1"><label for="price_tag"><span class="must-tag">*</span>价格标签</label></td>
                                <td class="td2"><input type="text" id="price_tag" name="price_tag" placeholder="价格标签"></td>
                                <td class="td3"></td>
                            </tr>
                            
                            <!-- 开启分销模式时 -->
                            <tr>
                                <td class="td1"><label for="self_fee_ratio"><span class="must-tag">*</span>一级佣金系数</label></td>
                                <td class="td2">
                                    <input type="text" id="self_fee_ratio" name="self_fee_ratio" placeholder="一级佣金系数"></td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label for="parent_fee_ratio"><span class="must-tag">*</span>二级佣金系数</label></td>
                                <td class="td2">
                                    <input type="text" id="parent_fee_ratio" name="parent_fee_ratio" placeholder="二级佣金系数"></td>
                                <td class="td3"></td>
                            </tr>
                            
                            <!--没有为当前分类绑定模板时，则当前商品为统一规格-->
                            <tr>
                                <td class="td1"><label for="inventory"><span class="must-tag">*</span>商品库存</label></td>
                                <td class="td2">
                                    <!--0为统一规格-->
                                    <input type="text" id="inventory" name="inventory" placeholder="商品库存">
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1">
                                    <label for="pids"><span class="must-tag">&nbsp;&nbsp;*</span>商家承诺</label></td>
                                <td class="td2">
                                    {foreach $promiseList as $key => $promise}
                                    <label class="for-right"><input name="pids[]" style="margin:0" class="my-icheckbox" type="checkbox" value="{$promise.id}"/>
                                        {$promise.content}</label>&nbsp;&nbsp;
                                    {if ($key + 1) %5 eq 0}
                                    </br>
                                    {/if}
                                    {/foreach}
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label for="unit"><span class="must-tag">*</span>商品单位</label></td>
                                <td class="td2">
                                    <select id="unit" name="unit" class="select-normal">
                                        {if $unitsList}
                                        {foreach $unitsList as $unit}
                                        <option>{$unit.name}</option>
                                        {/foreach}
                                        {else}
                                        <option>件</option>
                                        <option>斤</option>
                                        <option>箱</option>
                                        <option>桶</option>
                                        <option>盒</option>
                                        <option>袋</option>
                                        <option>个</option>
                                        <option>米</option>
                                        <option>张</option>
                                        <option>听</option>
                                        <option>罐</option>
                                        {/if}
                                    </select>
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr class="hidden">
                                <td class="td1"><label for="simpledesc"><span class="must-tag">*</span>商品简述</label></td>
                                <td class="td2"><input type="text" id="simpledesc" name="simple_desc" placeholder="商品简述"></td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label for="sortnum"><span class="must-tag">*</span>排序系数</label></td>
                                <td class="td2"><input type="text" id="sortnum" name="sort_num" value="5" placeholder="排序系数"></td>
                                <td class="td3"></td>
                            </tr>
                            <tr class="hidden">
                                <td class="td1"><label for="sortnum"><span class="must-tag">*</span>商品信息</label></td>
                                <td class="td2">
                                    <div class="goods-info">
                                        <input type="text" class="info-name" name="info_name[]" placeholder="信息名称" value="">
                                        <input type="text" class="info-value" name="info_value[]" placeholder="信息内容" value="">
                                        <button class="btn btn-danger btn-xs deleteInfo">删除</button>
                                        <button class="btn btn-info btn-xs addInfo">添加</button>
                                    </div>
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label><span class="must-tag">*</span>商品状态</label></td>
                                <td class="td2">
                                    <label> <input type="radio" name="updown" value="1" checked> 上架</label>&nbsp;&nbsp;
                                    <label> <input type="radio" name="updown" value="2">下架</label>
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1"><label><span class="must-tag">*</span>首页推荐</label></td>
                                <td class="td2">
                                    <label> <input type="radio" name="recommend" value="0" checked>不推荐</label>&nbsp;&nbsp;
                                    <label> <input type="radio" name="recommend" value="1">推荐</label>
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr class="hidden">
                                <td class="td1"><label><span class="must-tag">*</span>是否参与打折</label></td>
                                <td class="td2">
                                    <label> <input type="radio" name="is_discount" value="0" checked>不参与</label>&nbsp;&nbsp;
                                    <label> <input type="radio" name="is_discount" value="1">参与</label>
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr class="need-discount hidden">
                                <td class="td1">
                                    <label for="pids"><span class="must-tag">&nbsp;&nbsp;*</span>折扣分类</label></td>
                                <td class="td2">
                                    {foreach $discountCategoryInfo as $key=>$promise}
                                    <label class="for-right"><input name="discountCategoryId[]" style="margin:0" class="my-icheckbox" type="checkbox" value="{$promise.id}"/>
                                        {$promise.name}</label>&nbsp;&nbsp;
                                    {if  ($key+1) %5 eq 0}
                                    </br>
                                    {/if}
                                    {/foreach}
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1">
                                    <label for="buynote"><span class="must-tag">*</span>购物须知</label>
                                </td>
                                <td class="td2">
                                    <!-- umeditor -->
                                    <script type="text/plain" id="buynote" name="buy_note" style="width:780px;height:200px;"></script>
                                    <script type="text/javascript">
                                    //实例化编辑器
                                    var um = UM.getEditor('buynote');
                                    </script>
                                    <!-- /umeditor -->
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td class="td1">
                                    <label for="detaildesc"><span class="must-tag">*</span>详情描述</label>
                                </td>
                                <td class="td2">
                                    <!-- umeditor -->
                                    <script type="text/plain" id="detaildesc" name="detail_desc" style="width:780px;height:200px;"></script>
                                    <script type="text/javascript">
                                    //实例化编辑器
                                    var um = UM.getEditor('detaildesc');
                                    </script>
                                    <!-- /umeditor -->
                                </td>
                                <td class="td3"></td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="hidden" name="cids" id="cids" class="cids" value="{$cids}">
                                </td>
                                <td><button type="button" class="btn btn-success btn-md" id='save'>提交</button></td>
                                <td></td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 页脚 -->
{include file="common/page/footer"}

<script type="text/javascript" src="__static__/js/form/jquery.form.js"></script>
<script type="text/javascript" src="__static__/js/form/jquery.validate.js"></script>
<script type="text/javascript" src="__static__/js/form/jquery.validate.extend.js"></script>
<script type="text/javascript" src="__app__/admin/view/StoreGoods/addGoods/addGoods.js"></script>
</body>
</html>
